<template>
  <div class="MyDay11s">
    <h1>我是第二个子组件</h1>
    <h2>{{ sum }}</h2>
    <button @click="funAdd(2)">通过mutations中funAdd触发+2的函数第二种</button>
    <button @click="setFun(10)">通过actions中setFun触发+10的函数第二种</button>
    <h2>{{ bigNum }}</h2>
    <h1>{{ userName }}-----{{ age }}------{{ sex }}</h1>
  </div>
</template>

<script>
import { mapState,mapMutations,mapActions,mapGetters } from 'vuex';
export default {
    name:"MyDay11s",
    computed:{
      ...mapState(["sum","commit"]),
      ...mapGetters(["bigNum"]),
      ...mapState("stor1",['userName','age','sex']),

    },
    methods:{
        ...mapMutations(["funAdd"]),
        ...mapActions(["setFun"])

    }
}
</script>

<style scoped>
.MyDay11s {
    border: 5px solid red;
    height: 500px;
}
</style>